refactor(invoke): simplify extension map iteration#3913
Conversation
Use 'for k, v := range' instead of indexed map lookup when setting CloudEvent extensions. Signed-off-by: shreyaabaranwal <shreyabaranwal229@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: shreyaabaranwal The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @shreyaabaranwal. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/kind cleanup |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3913 +/- ##
==========================================
+ Coverage 52.49% 53.03% +0.54%
==========================================
Files 200 200
Lines 23687 23687
==========================================
+ Hits 12434 12563 +129
+ Misses 10030 9900 -130
- Partials 1223 1224 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
The E2E failure looks unrelated to this PR — |
There was a problem hiding this comment.
Pull request overview
This PR refactors CloudEvent extension assignment during func invoke by simplifying map iteration in sendEvent, keeping behavior the same while making the code clearer and slightly more efficient.
Changes:
- Replace “range keys then index into map” with
for k, v := range m.Extensionswhen setting CloudEvent extensions.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Use
for k, v := rangeinstead of indexed map lookup when setting CloudEvent extensions.Changes
for k, v := rangeinstead of looking up each value by key/kind cleanup
Relates to #3346
Release Note
Docs